package io.kiki.sba.registry.store.jdbc.config;

import lombok.Getter;
import org.springframework.boot.context.properties.ConfigurationProperties;


@ConfigurationProperties(prefix = JdbcDriverConfigBean.PRE_FIX)
public class JdbcDriverConfigBean implements JdbcDriverConfig {

    public static final String PRE_FIX = "jdbc";

    private String driverClassName = "com.mysql.jdbc.Driver";

    private String url = "jdbc:mysql://127.0.0.1:3306/registrymetadb?useUnicode=true&characterEncoding=utf8";

    private String username = "username";

    private String password = "password";

    @Getter
    private int slowSqlMillis = 1000;

    private String typeAliasesPackage;

    private String[] mapperLocations = {"classpath:mapper/*.xml"};

    private int minIdle = 5;

    private int maxActive = 25;

    private int maxWait = 2000;


    @Override
    public String getDriverClassName() {
        return driverClassName;
    }


    public void setDriverClassName(String driverClassName) {
        this.driverClassName = driverClassName;
    }


    @Override
    public String getUrl() {
        return url;
    }


    public void setUrl(String url) {
        this.url = url;
    }


    public String getUsername() {
        return username;
    }


    public void setUsername(String username) {
        this.username = username;
    }


    @Override
    public String getPassword() {
        return password;
    }


    public void setPassword(String password) {
        this.password = password;
    }


    @Override
    public String getTypeAliasesPackage() {
        return typeAliasesPackage;
    }


    public void setTypeAliasesPackage(String typeAliasesPackage) {
        this.typeAliasesPackage = typeAliasesPackage;
    }


    @Override
    public String[] getMapperLocations() {
        return mapperLocations;
    }


    public void setMapperLocations(String[] mapperLocations) {
        this.mapperLocations = mapperLocations;
    }


    @Override
    public int getMinIdle() {
        return minIdle;
    }


    public void setMinIdle(int minIdle) {
        this.minIdle = minIdle;
    }


    @Override
    public int getMaxActive() {
        return maxActive;
    }


    public void setMaxActive(int maxActive) {
        this.maxActive = maxActive;
    }


    @Override
    public int getMaxWait() {
        return maxWait;
    }


    public void setMaxWait(int maxWait) {
        this.maxWait = maxWait;
    }


    public void setSlowSqlMillis(int slowSqlMillis) {
        this.slowSqlMillis = slowSqlMillis;
    }
}
